﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Gene_Explorer_Client
{
    public partial class OrderWizardSelectDataSet : Form
    {
        public bool checkBoxFlag = false;
        public bool radioButtonFlag = false;

        public OrderWizardSelectDataSet()
        {
            InitializeComponent();
        }

        private void OrderWizardSelectDataSet_Load(object sender, EventArgs e)
        {

        }

        private void button_Cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button_Next_Click(object sender, EventArgs e)
        {
            this.Hide();
      //    this.Close();
            GlobalVariable.orderWSD = this;
       //   Console.WriteLine("你是this！！！" + this.ToString());
       //   Console.WriteLine("你是全局！！！" + GlobalVariable.orderWSD.ToString());
       //   this.Close();
            OrderWizardDataProcessing oWDP = new OrderWizardDataProcessing();
       //   oWDP.ShowDialog();
            oWDP.Show();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void textBox_Classification_TextChanged(object sender, EventArgs e)
        {

        }

        private void checkBox_Classification_CheckedChanged(object sender, EventArgs e)
        {
            //textBox_Classification//label1 label7
            label1.Enabled = !label1.Enabled;
            textBox_Classification.Enabled = !textBox_Classification.Enabled;
            label7.Enabled = !label7.Enabled;
            textBox_ClassNum.Enabled = !textBox_ClassNum.Enabled;
            label11.Enabled = !label11.Enabled;
            label10.Enabled = !label10.Enabled;

            /*
            if (checkBoxFlag == false)
            {
                label1.Enabled = true;
                textBox_Classification.Enabled = true;
                label7.Enabled = true;
            }
            else
            {
                label1.Enabled = false;
                textBox_Classification.Enabled = false;
                label7.Enabled = false;
            }
            checkBoxFlag = !checkBoxFlag;
             */ 
        }

        private void radioButton_RowColumn_CheckedChanged(object sender, EventArgs e)
        {
            //textBox_RowInf  label2 label3 label4 label5  textBox_RowSup   textBox_ColumnInf  textBox_ColumnSup
            if (radioButtonFlag == false)
            {
                textBox_RowInf.Enabled = true;
                textBox_RowSup.Enabled = true;
                textBox_ColumnInf.Enabled = true;
                textBox_ColumnSup.Enabled = true;
                label2.Enabled = true;
                label3.Enabled = true;
                label4.Enabled = true;
                label5.Enabled = true;
                label8.Enabled = true;
                label9.Enabled = true;
            }
            else
            {
                textBox_RowInf.Enabled = false;
                textBox_RowSup.Enabled = false;
                textBox_ColumnInf.Enabled = false;
                textBox_ColumnSup.Enabled = false;
                label2.Enabled = false;
                label3.Enabled = false;
                label4.Enabled = false;
                label5.Enabled = false;
                label8.Enabled = false;
                label9.Enabled = false;
            }
            radioButtonFlag = !radioButtonFlag;
        }

        private void textBox_RowInf_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = e.KeyChar < '0' || e.KeyChar > '9';   //允许输入数字
            if (e.KeyChar == (char)8)   //允许输入回退键
            {
                e.Handled = false;
            }
        }

        private void textBox_RowSup_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = e.KeyChar < '0' || e.KeyChar > '9';   //允许输入数字
            if (e.KeyChar == (char)8)   //允许输入回退键
            {
                e.Handled = false;
            }
        }

        private void textBox_ColumnInf_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = e.KeyChar < '0' || e.KeyChar > '9';   
            if (e.KeyChar == (char)8)   
            {
                e.Handled = false;
            }
        }

        private void textBox_ColumnSup_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = e.KeyChar < '0' || e.KeyChar > '9';   
            if (e.KeyChar == (char)8)   
            {
                e.Handled = false;
            }
        }

        private void textBox_Classification_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = e.KeyChar < '0' || e.KeyChar > '9';   
            if (e.KeyChar == (char)8)   
            {
                e.Handled = false;
            }
        }

        private void textBox_ClassNum_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = e.KeyChar < '0' || e.KeyChar > '9';
            if (e.KeyChar == (char)8)
            {
                e.Handled = false;
            }
        }
    }
}
